<template>
  <div class="pagination">
    <a-pagination
      :pageSize="params1.pageSize"
      v-model="params1.pageNum"
      @change="pageChange"
      :show-total="total => `总 ${total} 条`"
      :total="total"
      show-less-items
      hideOnSinglePage
    />
  </div>
</template>

<script>
export default {
  props: {
    params: {
      type: Object,
      default: function() {
        return {}
      }
    },
    total: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      params1: this.params
    }
  },
  methods: {
    pageChange(a, b) {
      this.params1.pageNum = a
      this.params1.pageSize = b
      this.$emit('method', this.params1)
    }
  }
}
</script>

<style lang="scss" scoped>
.pagination {
  position: absolute;
  bottom: 10px;
  width: 90%;
  display: flex;
  justify-content: center;
}
</style> 